
package poker.plans.player;

import jadex.runtime.*;

import poker.beliefs.*;


public class WinnerPlan extends Plan {

	public void body() {
		System.out.println("PLAYER "+getAgentName()+": I'm the best!!");
		
		//Get the money that we won
		IMessageEvent request = (IMessageEvent) getInitialEvent();
		int earning = ((Integer)request.getContent()).intValue();
		
		//Update my money
		Money budget = (Money)getBeliefbase().getBelief("money").getFact();
		budget.addMoney(earning);
		getBeliefbase().getBelief("money").setFact(budget);
		
		// Reset some beliefs
		getBeliefbase().getBelief("hand").setFact(new Hand());
		getBeliefbase().getBelief("mypot").setFact(new Integer(0));
		getBeliefbase().getBelief("blind").setFact(new Integer(0));
	}

}
